const accessTokenKey = 'accessToken'
const refreshTokenKey = 'refreshToken'
const qAccessTokenKey = 'q_AT'
const qRefreshTokenKey = 'q_RT'
const qEncUserKey = 'q_enc_user'

export function getToken() {
  return localStorage.getItem(accessTokenKey)
}

export function setAccessToken(accessToken: string) {
  localStorage.setItem(accessTokenKey, accessToken)
  return 'OK'
}

export function setRefreshToken(refreshToken: string) {
  localStorage.setItem(refreshTokenKey, refreshToken)
  return 'OK'
}

export function removeToken() {
  localStorage.removeItem(accessTokenKey)
  localStorage.removeItem(refreshTokenKey)
}

// 企业预警通部分
export function setqAT(qAccessToken: string) {
  return localStorage.setItem(qAccessTokenKey, qAccessToken)
}
export function setqRT(qRefreshToken: string) {
  return localStorage.setItem(qRefreshTokenKey, qRefreshToken)
}
export function setqEU(qEncUser: string) {
  return localStorage.setItem(qEncUserKey, qEncUser)
}
export function getqAT() {
  return localStorage.getItem(qAccessTokenKey)
}
export function getqRT() {
  return localStorage.getItem(qRefreshTokenKey)
}
export function getqEU() {
  return localStorage.getItem(qEncUserKey)
}
